package com.boot.dongli.plugins;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author: lkz
 * @Title: PluginsConMsg
 * @Description: 解决消息先进先出 问题
 * @Date: 2023/10/16 17:08
 */
@Component
@Slf4j
public class PluginsConMsg {


    /**
     * 接收延迟队列消息，延迟队列使用的是延迟交换机插件
     */
    @RabbitListener(queues = "plugin_queue")
    public void receiveMsg(Message message){
        String body=new String(message.getBody());
        log.info("接收到的消息为：{},接收时间为：{}",body,new Date());
    }

}
